# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Language.V2.Model.XPSColumnSpec do
  @moduledoc """


  ## Attributes

  *   `columnId` (*type:* `integer()`, *default:* `nil`) - The unique id of the column. When Preprocess, the Tables BE will popuate the order id of the column, which reflects the order of the column inside the table, i.e. 0 means the first column in the table, N-1 means the last column. AutoML BE will persist this order id in Spanner and set the order id here when calling RefreshTablesStats and Train. Note: it's different than the column_spec_id that is generated in AutoML BE.
  *   `dataStats` (*type:* `GoogleApi.Language.V2.Model.XPSDataStats.t`, *default:* `nil`) - The data stats of the column. It's outputed in RefreshTablesStats and a required input for Train.
  *   `dataType` (*type:* `GoogleApi.Language.V2.Model.XPSDataType.t`, *default:* `nil`) - The data type of the column. It's outputed in Preprocess rpc and a required input for RefreshTablesStats and Train.
  *   `displayName` (*type:* `String.t`, *default:* `nil`) - The display name of the column. It's outputed in Preprocess and a required input for RefreshTablesStats and Train.
  *   `forecastingMetadata` (*type:* `GoogleApi.Language.V2.Model.XPSColumnSpecForecastingMetadata.t`, *default:* `nil`) - 
  *   `topCorrelatedColumns` (*type:* `list(GoogleApi.Language.V2.Model.XPSColumnSpecCorrelatedColumn.t)`, *default:* `nil`) - It's outputed in RefreshTablesStats, and a required input in Train.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :columnId => integer() | nil,
          :dataStats => GoogleApi.Language.V2.Model.XPSDataStats.t() | nil,
          :dataType => GoogleApi.Language.V2.Model.XPSDataType.t() | nil,
          :displayName => String.t() | nil,
          :forecastingMetadata =>
            GoogleApi.Language.V2.Model.XPSColumnSpecForecastingMetadata.t() | nil,
          :topCorrelatedColumns =>
            list(GoogleApi.Language.V2.Model.XPSColumnSpecCorrelatedColumn.t()) | nil
        }

  field(:columnId)
  field(:dataStats, as: GoogleApi.Language.V2.Model.XPSDataStats)
  field(:dataType, as: GoogleApi.Language.V2.Model.XPSDataType)
  field(:displayName)
  field(:forecastingMetadata, as: GoogleApi.Language.V2.Model.XPSColumnSpecForecastingMetadata)

  field(:topCorrelatedColumns,
    as: GoogleApi.Language.V2.Model.XPSColumnSpecCorrelatedColumn,
    type: :list
  )
end

defimpl Poison.Decoder, for: GoogleApi.Language.V2.Model.XPSColumnSpec do
  def decode(value, options) do
    GoogleApi.Language.V2.Model.XPSColumnSpec.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Language.V2.Model.XPSColumnSpec do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
